package test_model_base;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import com.servlet.model.base.Status;

public class StatusTest extends TestCase {
	private Status status;

	@Before
	public void setUp() throws Exception {
		super.setUp();
		status = new Status();
	}

	@After
	public void tearDown() throws Exception {
		super.tearDown();
		status = null;
	}

	@Test
	public void testStatus() {
		Assert.assertNotNull(status);
		Assert.assertEquals(0, status.getId());
		Assert.assertEquals("Aucun", status.getStatus());
	}

	@Test
	public void testStatusString() {
		status = new Status("Recherche un ou plusieurs employs");
		Assert.assertNotNull(status);
		assertNotNull(status);
		Assert.assertEquals(3, status.getId());
		Assert.assertEquals("Recherche un ou plusieurs employs", status.getStatus());
	}

	@Test
	public void testStatusInt() {
		status = new Status(1);
		assertNotNull(status);
		Assert.assertEquals(1, status.getId());
		Assert.assertEquals("Recherche un emploi", status.getStatus());
	}

	@Test
	public void testSetStatusInt() {
		Assert.assertEquals(0, status.getId());
		Assert.assertEquals("Aucun", status.getStatus());
		status.setStatus(-1);
		Assert.assertEquals(0, status.getId());
		Assert.assertEquals("Aucun", status.getStatus());
		status.setStatus(6);
		Assert.assertEquals(0, status.getId());
		Assert.assertEquals("Aucun", status.getStatus());
		status.setStatus(1);
		Assert.assertEquals(1, status.getId());
		Assert.assertEquals("Recherche un emploi", status.getStatus());
	}

	@Test
	public void testSetStatusString() {
		Assert.assertEquals(0, status.getId());
		status.setStatus("Recherche un stage");
		Assert.assertEquals(2, status.getId());
	}

	@Test
	public void testGetStatus() {
		Assert.assertEquals("Aucun", status.getStatus());
	}

	@Test
	public void testGetId() {
		Assert.assertEquals(0, status.getId());
	}

}
